﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using ServicesComponent.Repositories.Core;
using Business_Objects;
using Data_Objects;
namespace ServicesComponent.Repositories
{
    ///// <summary>
    ///// TaiSan Repository. Good example of CRUD operations.
    ///// </summary>
    public class TaiSanRepository : ITaiSanRepository
    {
        private static readonly ITaiSanDao _taiSan = DataAccess.TaiSanDao;
        public List<TaiSan> GetList()
        {
            return _taiSan.GetTaiSan().ToList();
        }

        public TaiSan Get(string id)
        {
            return _taiSan.GetTaiSanByID(id);
        }

        public void Insert(TaiSan t)
        {
            _taiSan.InsertTaiSan(t);
        }

        public void Update(TaiSan t)
        {
            _taiSan.UpdateTaiSan(t);
        }

        public void Delete(TaiSan t)
        {
            _taiSan.DeleteTaiSan(t);
        }

        public List<TaiSan> GetTaiSanBySchoolId(int schoolId)
        {
        return    _taiSan.GetTaiSanBySchoolId(schoolId);
        }
    }
}